<!doctype html>
<html class="no-js">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>{$site_title}</title>
  <meta name="description" content="">
  <meta name="keywords" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <link rel="stylesheet" type="text/css" href="http://apps.bdimg.com/libs/blendui/2.0.0/boost.min.css" />
  <link rel="stylesheet" type="text/css" href="{$resource_basic}/css/webapp.css" />
  <script type="text/javascript" src="{$resource_basic}/js/jquery.min.js"></script>
  <script type="text/javascript" src="http://apps.bdimg.com/libs/blendui/2.0.0/boost.min.js"></script>
  <script type="text/javascript">
    window.boost = $.noConflict(true);
    </script>
<style>
body{
    background-color: #fff;
}
.blend-fixedBar{
    height: auto;
}
.blend-imglist-small a img{width:4.5rem; height:4.5rem; border-radius: 100%;}
.blend-imglist-small a p{ margin-top:-10px; font-size: 1.4rem;}
a{ color: #8A8A8A;}
a:hover{ color:#8A8A8A;}
.blend-title span{ color: #00B0FC; font-size: 1.6rem;}
.blend-card-sub-title{ margin-top:10px; color: #FF617B;}
.vote_btn{border-radius: 24px; background-color: #FF617B; border: none; color: #fff; width: 6rem;}
.vote_btn_f{border-radius: 24px; background-color: #A2A2A2; border: none; color: #fff; width: 6rem;}
.blend-vote{ position: absolute; top:1rem; right: 1rem; top:2rem;}
</style>
</head>

<body>
    <!--头部固定导航-->
<div>
        
    <div data-blend-widget="fixedBar" class="blend-fixedBar blend-fixedBar-top" style=' background-color: #fff;z-index: 1000;border-bottom: 1px solid #dcdcdc;'>
        <div class="blend-imglist" id="imglist1">
            <ul class="blend-imglist-wrapper blend-imglist-theme">
                <li class="blend-imglist-item blend-imglist-small">
                    <a href="{:U('M/Acshiyaoju/like_product_list')}">
                        <img src="__PUBLIC__/template/default/img/acsuzhoulike/menu1.png">
                        <p>投票列表</p>
                    </a>
                </li>
                <li class="blend-imglist-item blend-imglist-small">
                    <a href="{:U('M/Acshiyaoju/like_product_success_list')}">
                        <img src="__PUBLIC__/template/default/img/acsuzhoulike/menu2-f.png">
                        <p>送检产品</p>
                    </a>
                </li>
                <li class="blend-imglist-item blend-imglist-small">
                    <a href="{:U('M/Acshiyaoju/like_product_diy_submit')}">
                        <img src="__PUBLIC__/template/default/img/acsuzhoulike/menu3-f.png">
                        <p>上传产品</p>
                    </a>
                </li>
                <li class="blend-imglist-item blend-imglist-small">
                    <a href="{:U('M/Acshiyaoju/like_notice')}">
                        <img src="__PUBLIC__/template/default/img/acsuzhoulike/menu4-f.png">
                        <p>活动说明</p>
                    </a>
                </li>
            </ul>
        </div>
    </div>
    
    
    <div style=" height:11rem; "></div>
    <!--二级标题-->
    <div class="blend-title">
        <span>投票列表</span>
    </div>
    
    <volist name="list" id="vo">
    <div class="blend-card blend-card-no-icon">
        <div class="blend-card-img-view">
            <img src="{$vo.img}">
        </div>
        <div class="blend-card-content-view" style="padding-left:10px;">
            <div class="blend-card-title">
                {$vo.name}
            </div>
            <div class="blend-card-sub-title">票数：{$vo.vote_num}</div>
        </div>
        <div class="blend-card-content-view blend-vote">
            <!-- <a href="javascript:add_one_vote({$vo.id});"><button class="blend-button blend-button-default vote_btn">投票</button></a> -->
            <!-- {$vo.is_vote} -->
            <if condition="$vo.is_vote eq 0">
            <a href="javascript:add_one_vote({$vo.id});"><button id='btn{$vo.id}' class="blend-button blend-button-default vote_btn">投票</button></a>
            <else/>
            <button class="blend-button blend-button-default vote_btn_f">投票</button>
            </if>
        </div>
    </div>
    </volist>
</div> 
<script type="text/javascript">
function add_one_vote(pid){
    var url = "{:U('M/Acshiyaoju/add_one_vote')}";
    var btn = $("#btn"+pid);
    // alert(pid); return;
    $.ajax({
        type:'post',
        url:url,
        data:{pid:pid},
        dataType:'json',
        success:function(data){
            if(data===1){
                btn.removeClass("vote_btn").addClass("vote_btn_f");
                window.location.href = "{:U('M/Acshiyaoju/like_product_list')}";
            }
        }
    });
}
</script>
</body>
</html>